<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="/scripts/jquery/jquery-1.7.1.js"></script>
    <link href="/style/authority/basic_layout.css" rel="stylesheet" type="text/css">
    <link href="/style/authority/common_style.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="/scripts/authority/commonAll.js"></script>
    <script type="text/javascript" src="/scripts/fancybox/jquery.fancybox-1.3.4.js"></script>
    <script type="text/javascript" src="/scripts/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
    <link rel="stylesheet" type="text/css" href="/style/authority/jquery.fancybox-1.3.4.css" media="screen"></link>
    <script type="text/javascript" src="/scripts/artDialog/artDialog.js?skin=default"></script>
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css">
    <title>房屋信息销售列表</title>
    <style>
        .alt td{ background:black !important;}
    </style>
</head>
<script src="/js/jquery-1.8.3.js"></script>
<input type="hidden" name="_token" id='token' value="{{csrf_token()}}"/>
<body>
<form id="submitForm" name="submitForm" action="" method="post">
    <input type="hidden" name="allIDCheck" value="" id="allIDCheck"/>
    <input type="hidden" name="fangyuanEntity.fyXqName" value="" id="fyXqName"/>
    <div id="container">
        <div class="ui_content">
            <div class="ui_text_indent">
                <div id="box_border">
                    <div id="box_top">搜索</div>
                    <div id="box_center">
                        地区
                        <select id="select1" name="fangyuanEntity.fyXqCode" id="fyXq" class="ui_select01" onchange="getFyDhListByFyXqCode();">
                            <option value="">--请选择--</option>
                            {{--@foreach($str as $v)
                            <option value="{{$v}}" id="house_region">
                                {{$v}}
                            </option>
                            @endforeach--}}
                            <option value="北京" id="house_region">北京</option>
                            <option value="天津" id="house_region">天津</option>
                        </select>

                        小区
                        <select  id="select2" name="fangyuanEntity.fyDhCode" id="fyDh" class="ui_select01">
                            <option value="">--请选择--</option>
                            @foreach($data as $v)
                                <option value="{{$v->house_village_name}}" id="house_village_name">{{$v->house_village_name}}</option>
                            @endforeach
                        </select>
                        价格
                        <select id="select3" name="fangyuanEntity.fyHxCode" id="fyHx" class="ui_select01">
                            <option value="">--请选择--</option>
                            <option value="1" id="house_price">1500元以下</option>
                            <option value="2" id="house_price">1500-2000元</option>
                            <option value="3" id="house_price">2000元以上</option>

                        </select>
                        状态
                        <select id="select4" name="fangyuanEntity.fyStatus" id="fyStatus" class="ui_select01">
                            <option value="" checked>--请选择--</option>
                            <option value="1" id="is_lease">已出租</option>
                            <option value="2" id="is_lease">未出租</option>

                        </select>
                        <input type="button" value="查询" class="ui_input_btn01" onclick="search();" />

                    </div>
                    <div id="box_bottom">
                        <input type="button" value="My日志" class="ui_input_btn01" onclick="journal();" />
                    </div>
                </div>
            </div>
        </div>

        @include('admin.sale.middle')
    </div>
</form>

</body>
</html>

<script type="text/javascript">

    //查询
    function search()
    {
        var options=$("#select1 option:selected");
        var house_region = options.val();

        var options=$("#select2 option:selected");
        var house_village_name = options.val();

        var options=$("#select3 option:selected");
        var house_price = options.val();

        var options=$("#select4 option:selected");
        var is_lease = options.val();

        console.log(house_region);
        console.log(house_village_name);
        console.log(house_price);
        console.log(is_lease);

        var token=$('#token').val();


        var data = new FormData();
        data.append('house_region', house_region);
        data.append('house_village_name',house_village_name);
        data.append('house_price', house_price);
        data.append('is_lease', is_lease);
        data.append('_token', token);
        $.ajax({
            type:'post',
            url:"{{url('/admin/search')}}",
            data:data,
            cache: false,
            processData: false,
            contentType: false,
            success:function(msg){
                if(msg){
                    $("#box").html(msg)
                }else{
                    alert('抱歉，没有符合的词条，请重新搜索！');
                    /*var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);//关闭弹出层*/
                }
            }
        });
    }

    function journal()
    {
       location.href="{{url('/admin/journal')}}"
    }
</script>